package com.geologyoa.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.geologyoa.domain.Dwqk01;
import com.geologyoa.service.SystemManager;
import com.geologyoa.service.SystemManagerImpl;

public class UpdateDwqk01Servlet extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
       doPost(request,response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		SystemManager sys=new SystemManagerImpl();
		response.setContentType("text/xml;charset=utf-8");
		boolean flag = false;
		Dwqk01 dwqk01=new Dwqk01();
		// add by cuiyi 用索引值去更新   废弃之前定义的单位统一编号
		String id = request.getParameter("DWQK0101");
		if(id==null||id.equals(""))
			response.getWriter().write(String.valueOf(flag));
		int QWQK0101 =Integer.parseInt(id);
		////
		String DWQK0102=request.getParameter("DWQK0102");
		String DWQK0103=request.getParameter("DWQK0103");
		String DWQK0104=request.getParameter("DWQK0104");
		String DWQK0105=request.getParameter("DWQK0105");
		String DWQK0106=request.getParameter("DWQK0106");
		String DWQK0107=request.getParameter("DWQK0107");
		String DWQK0108=request.getParameter("DWQK0108");
		//modify by  cuiyi   判断如果传递过来的数值为空的话，强转会失败
		String dwqk0109Str = request.getParameter("DWQK0109");
		Double DWQK0109=Double.valueOf(dwqk0109Str==null||dwqk0109Str.equals("")?"0":dwqk0109Str).doubleValue(); 
		String DWQK0110=request.getParameter("DWQK0110");
		String DWQK0111=request.getParameter("DWQK0111");
		String DWQK0113=request.getParameter("DWQK0113");
		String DWQK0114=request.getParameter("DWQK0114");
		String DWQK0116=request.getParameter("DWQK0116");
		String DWQK0117=request.getParameter("DWQK0117");
		dwqk01.setDwqk0101(QWQK0101);
		dwqk01.setDwqk0102(DWQK0102);
		dwqk01.setDwqk0103(DWQK0103);
		dwqk01.setDwqk0104(DWQK0104);
		dwqk01.setDwqk0105(DWQK0105);
		dwqk01.setDwqk0106(DWQK0106);
		dwqk01.setDwqk0107(DWQK0107);
		dwqk01.setDwqk0108(DWQK0108);
		dwqk01.setDwqk0109(DWQK0109);
		dwqk01.setDwqk0110(DWQK0110);
		dwqk01.setDwqk0111(DWQK0111);
		dwqk01.setDwqk0113(DWQK0113);
		dwqk01.setDwqk0114(DWQK0114);
		dwqk01.setDwqk0116(DWQK0116);
		dwqk01.setDwqk0117(DWQK0117);
   		flag=sys.UpdateDwqk(dwqk01);
		/*if(flag==true)
		{
			response.getWriter().write("true");
		}else{
			response.getWriter().write("false");
		}*/
   		//modify by  cuiyi  精简代码
   		response.getWriter().write(String.valueOf(flag));
	}

}
